package home

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"telemple_web/app/http/controllers/home/params"
	"telemple_web/app/utils/r"
)

func Info(ctx *gin.Context) {
	var info params.Info
	if err := ctx.ShouldBind(&info); err != nil {
		ctx.JSON(http.StatusOK, map[string]any{
			"code":    http.StatusGone,
			"success": false,
			"message": "参数错误 " + err.Error(),
			"data":    nil,
		})
		return
	}
	r.Go(func() {
		panic("吃屎把你")
	})
	ctx.JSON(http.StatusOK, map[string]any{
		"code":    0,
		"success": true,
		"message": "success",
		"data":    map[string]any{"des": "hello world"},
	})
}
